package cn.edu.Day11;

import java.io.File;
import java.io.IOException;

public class PipedTest {
    public static void main(String[] args) {

        File srcFile = new File("cn.edu.xju.api/src/resources/out.txt");
        File descFile = new File("cn.edu.xju.api/src/resources/in.txt");


        PipedOutput po = new PipedOutput(descFile);
        PipedInput pi = new PipedInput(srcFile);
        try {
            pi.getOutputStream().connect(po.getInputStream());
        } catch (IOException e) {
            e.printStackTrace();
        }
        new Thread(po).start();
        new Thread(pi).start();

        System.out.println("管道流数据传输完毕");

    }
}
